<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>三元运算（条件运算符）</h2>
    <p>语法：布尔表达式 ? 真的值 : 假的值</p>
    <script>
        let score = 70;
        let r = score >= 60 ? "及格" : "不及格";
        console.log(r);

        r = score >= 90 ? "优秀" : score >= 80 ? "良好" : score >= 70 ? "中等" : score >= 60 ? "及格" : "不及格";
        console.log(r);
    </script>
</body>
</html>